/**
 * 
 */
package com.qb.mobile;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.qb.mobile.R;
import com.qb.Contants;
import com.qb.mobile.core.AboutAction;
import com.qb.mobile.core.actionbar.ActionBar;

/**
 * @author <a href="mailto:dangcongthanhtrung@gmail.com">dangtrung</a>
 * 
 * PhonebookMain.java class
 */
public class PhonebookMain extends Activity {
	
	private ActionBar actionBar;
	private Intent intentPhonebook;
	
	/**
	 * Called when the activity is first created.
	 */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.phone_book_main);
		//setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		
		actionBar = (ActionBar) findViewById(R.id.actionbar);
		actionBar.setTitle(getResources().getString(R.string.activity_title_main));
		
		// Load information about
		actionBar.setHomeAction(new AboutAction());
		
		//get Intent of PhonebookList
		intentPhonebook = new Intent(this, PhonebookList.class);
	}
	
	public void onBusinessClick(View view){
		intentPhonebook.putExtra(Contants.TITLE_CONTACT_GROUP, 
				getResources().getString(R.string.activity_title_business));
		startActivity(intentPhonebook);
	}
	
	public void onFavoritesClick(View view){
		intentPhonebook.putExtra(Contants.TITLE_CONTACT_GROUP, 
				getResources().getString(R.string.activity_title_favorites));
		startActivity(intentPhonebook);
	}
	
	public void onFamilyClick(View view){
		intentPhonebook.putExtra(Contants.TITLE_CONTACT_GROUP, 
				getResources().getString(R.string.activity_title_family));
		startActivity(intentPhonebook);
	}
	
	public void onFriendsClick(View view){
		intentPhonebook.putExtra(Contants.TITLE_CONTACT_GROUP, 
				getResources().getString(R.string.activity_title_friends));
		startActivity(intentPhonebook);
	}
	
	public void onNoneClick(View view){
		intentPhonebook.putExtra(Contants.TITLE_CONTACT_GROUP, 
				getResources().getString(R.string.activity_title_none));
		startActivity(intentPhonebook);
	}
	
	public void onVipClick(View view){
		intentPhonebook.putExtra(Contants.TITLE_CONTACT_GROUP, 
				getResources().getString(R.string.activity_title_vip));
		startActivity(intentPhonebook);
	}
}
